<%@ page language="java" contentType="text/html" import="java.util.List,com.beans.*,com.utils.*,com.dao.*" pageEncoding="utf-8"%>
<%String path = request.getContextPath();String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="css/edittable.css"></link>
<link rel="stylesheet" type="text/css" href="css/validate.css"></link>
<script type="text/javascript" src="js/jquery-1.8.0.js"></script>
</head>

<body>

	
	<div class="div_title">
		<div class="div_titlename">
			<img src="images/san_jiao.gif"><span>管理员角色分配</span>
		</div>
	</div>

	<form id="role_add_form" action="RoleServlet.do" method="post" >
		<input type="hidden" name="flag" value="adminroleEdit">
		<input type="hidden" name="adminId" value="${admin.id}">
		<table class="edit_table">
			<tr>
				<td class="td_info">
					用户账号:
				</td>
				<td class="td_input_short">
					<input type="text" class="txtbox" id="adminName" name="adminName" readonly="readonly" value="${admin.adminName}"/>
				</td>
			
			</tr>
			
			<tr>
				<td class="td_info">
					用户角色:
				</td>
				<td>
					<ul>
						<c:forEach var="r" items="${roleList}">
						
							<c:if  test="${r.id==admin.roleId}">
								<script>
									$(function(){
										$("#${r.id}").attr("checked", true);
									});	
								</script>
							</c:if>
							
							<li style="list-style-type: none">
								<input type="radio" id="${r.id}" name="roleId" value="${r.id}"/>${r.roleName}
							</li>
						</c:forEach>
					</ul>
						
				</td>
			</tr>
			
			<tr>
				<td class="td_info"></td>
				<td>
					<input id="form_btn" class="form_btn" type="submit" value="提交" /> 
					<input type="reset" class="form_btn" value="重置" />
				</td>
				<td>
					<label id="result_msg" class="result_msg">${msg}</label>
				</td>
			</tr>
		</table>
	</form>
	
	<script type="text/javascript">
		var msg_adminrole='${msg_adminrole}';
	 	 if(msg_adminrole!=''){
	 	 	alert(msg_adminrole);
	 	 }		  	 
	</script>
</body>
</html>
